package one;

import java.util.Scanner;

public class Fangfa {
    public static void main(String[] args) {
        /*
        //max
        int a = max(10,20);
        int b = max(30,20);
        System.out.println("10和20比较最大值是:"+a);
        System.out.println("20和30比较最大值是:"+b);
        //min
        int c = min(9,7);
        System.out.println("9和7比较最小值是:"+c);

        //jia
        jia(12,14);
        //max1
        max1(30,20);
        max1(8,9);


        chengJi(90);
        chengJi(80);
        chengJi(70);
        chengJi(60);
        chengJi(40);
  */

        jiafa(1,2);
        jiafa(1.3,2.4);


    }



    //未设定返回值类型可以用System;
    public static void jia(int a, int b){
        System.out.println(a+b);
    }

    //三元运算符
    public static void max1(int a,int b){
        System.out.println(a > b ? a : b);  //如果a大于b成立则输出问好后面的值;否则输出冒号后面的值;
    }

    //设定返回值类型必须用return;
    public static int max(int a,int b){
        int x;
        if (a>b)
            x = a;
        else
            x = b;
        return x;
    }
    //
    public static int min(int a,int b){
        int c;
        if (a>b)
            c = b;
        else
            c = a;
        return c;
    }


    //
    public static void chengJi(double a){
        if (a>=90)
            System.out.println("优秀");
        else if (a>=80)
            System.out.println("有点优秀");
        else if (a>=70)
            System.out.println("良");
        else if (a>=60)
            System.out.println("及格");
        else if (a<60)
            System.out.println("不及格");
    }



    //方法重载方法名相同,但是有不同的参数列表;
    public static void jiafa(int a,int b){
        System.out.println(a+b);
    }

    public static void jiafa(double c,double d){
        System.out.println(c+d);
    }





}








